package com.homework.work04;

public class RecursiveDemo  {
    //1.用递归的方式：从1打印到100
    void print(int i) {
        if(i<=100) {
            System.out.println(i);
            i++;
            print(i);
        }
    }
    public static void main(String[] args) {
        RecursiveDemo recursiveDemo = new RecursiveDemo();
        recursiveDemo.print(1);
    }
}
